import {
  Entity,
  Unique,
  Column,
  PrimaryGeneratedColumn,
  OneToMany,
} from 'typeorm';

@Entity()
export class Menu {
  @PrimaryGeneratedColumn()
  id: number;

  @Column()
  @Unique(['path'])
  path: string;

  @Column()
  @Unique(['name'])
  name: string;

  @Column()
  redirect: string;

  @Column()
  meta: string;

  @Column()
  parentId: number;

  //1:可用，0:不可用
  @Column({ default: 1 })
  active: number;
}
